package com.sunyard.manage.service;


//import com.netflix.ribbon.proxy.annotation.Http;

import com.sunyard.dal.bo.*;
import com.sunyard.dal.bo.operator.*;
import com.sunyard.dal.bo.sys.AuditPasswordBo;
import com.sunyard.dal.bo.sys.AuthorityUpdateBo;
import com.sunyard.dal.dto.LoginBackDTO;
import com.sunyard.dal.entity.Operator;
import com.sunyard.dal.entity.suzhou.WarnVo;
import com.sunyard.dal.vo.inspect.PcInspect;
import com.sunyard.utils.Response.BaseResult;
import com.sunyard.utils.manage.DataGrid;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Description:用户服务层接口
 * @author:zhangbin
 * @date:2017年7月11日 上午9:41:21
 */
public interface OperatorService {

    /**
     * @Description: 用户登录
     * @Author: jiy.fang
     * @Date: 2019/7/16 19:47
     */
    BaseResult<LoginBackDTO> logIn(HttpServletResponse response, HttpServletRequest request, OperatorLoginBO operatorLoginBO) throws Exception;

    /**
     * @description TODO
     * @author tsz
     * @date 2022/12/16
     * @param response
 * @param request
 * @param userId
     * @return BaseResult<LoginBackDTO> 
     * @throws 
    */
    BaseResult<LoginBackDTO> logInById(HttpServletResponse response, HttpServletRequest request, String userId) throws Exception;

    /**
     * @Description: 用户登出
     * @Author: jiy.fang
     * @Date: 2019/7/17 9:47
     */
    BaseResult logOut(HttpServletRequest request) throws Exception;

    /**
     * @Description: 修改用户密码
     * @Author: jiy.fang
     * @Date: 2019/7/17 11:08
     */
    BaseResult updatePwd(HttpServletRequest request, OperatorUpdatePwdBO operatorUpdatePwdBO);

    /**
     * @Description: 分页查询用户信息
     * @Author: jiy.fang
     * @Date: 2019/7/23 9:53
     */
    BaseResult<DataGrid<Operator>> queryOrganizationByPage(HttpServletRequest request, PaginationBO<OperatorQueryBO> queryBO) throws Exception;

    BaseResult<DataGrid<WarnVo>> queryOperatorWarn(HttpServletRequest request, PaginationBO<OperatorQueryBO> queryBO);
    int queryOperatorWarnCount();

    /**
     * @Description: 添加用户
     * @Author: jiy.fang
     * @Date: 2019/7/23 17:52
     */
    BaseResult insertOperator(HttpServletRequest request, OperatorAddBO operatorAddBO) throws Exception;

    /**
     * @Description: 修改用户
     * @Author: jiy.fang
     * @Date: 2019/7/23 19:07
     */
    BaseResult updateOperator(HttpServletRequest request, OperatorUpdateBO operatorUpdateBO) throws Exception;

    /**
     * @Description: 删除用户
     * @Author: jiy.fang
     * @Date: 2019/7/23 19:29
     */
    BaseResult deleteOperator(HttpServletRequest request, OperatorDeleteBO operatorDeleteBO) throws Exception;

    //重置密码
    BaseResult resetPwd(HttpServletRequest request, ResetPasswordBO resetPasswordBO) throws Exception;

    //重置初始化密码
    BaseResult resetInitPwd(HttpServletRequest request, ResetInitPasswordBO resetInitPasswordBO);

    //登录解锁
    BaseResult unlockOperator(HttpServletRequest request, UnlockOperatorBO unlockOperatorBO) throws Exception;

    //用户启用
    BaseResult enableOperator(HttpServletRequest request, EnableOperatorBO enableOperatorBO) throws Exception;

    //用户停用
    BaseResult disableOperator(HttpServletRequest request, DisableOperatorBO disableOperatorBO) throws Exception;

    //用户导出
    List<Operator> getListOperatorExport(HttpServletRequest request, OperatorQueryBO queryBO);

    //验证是否已经登录
    String checklogin(HttpServletRequest request) throws Exception;

    //用户名转换
    String userConvert(String userIds) ;

    //实时获取用户信息
    BaseResult<LoginBackDTO> getOperatorInfo(HttpServletRequest request) throws Exception;

    /**
     * 获取本机构巡检客户经理
     *
     * @param orgId 机构id
     * @return list
     */
    BaseResult<List<PcInspect>> selectInspect(String orgId);

    List<String> getListOrgIds(String orgId);

    BaseResult<List<Operator>> getOperatorListByRoleOrg(HttpServletRequest request, OperatorQueryBO operatorQueryBO);

    BaseResult<List<PcInspect>> auditPassword(AuditPasswordBo auditPasswordBo) throws Exception;

    /**
     * 转授权
     *
     * @param authorityUpdateBo 转授权
     * @return list
     */
    BaseResult updateAuthority(HttpServletRequest request, AuthorityUpdateBo authorityUpdateBo);

    /**
     * 授权回退
     *
     * @param authorityUpdateBo 授权回退
     * @return list
     */
    BaseResult rollBackAuthority(HttpServletRequest request, AuthorityUpdateBo authorityUpdateBo);

    /**
     * 指纹登录
     *
     * @param response
     * @param request
     * @param handLoginBO [response, request, handLoginBO]
     * @return BaseResult<LoginBackDTO>
     * @author: guangw.dang
     * @Date: 2022/7/12 10:56
     **/
    BaseResult<LoginBackDTO> handLogin(HttpServletResponse response, HttpServletRequest request, HandLoginBO handLoginBO);

    /**
     * @Description: 导入添加用户
     * @Author: chengy.wei
     * @Date: 2022/7/21 10:00
     */
    BaseResult insertOperatorByImport(HttpServletRequest request, OperatorAddBO operatorAddBO, String roleName) throws Exception;

    BaseResult batchDeleteOperator(HttpServletRequest request, OperatorDeleteBO operatorDeleteBO) throws Exception;

    BaseResult batchResetPwd(HttpServletRequest request, ResetPasswordBO resetPasswordBO) throws Exception;

    BaseResult batchUnlock(HttpServletRequest request, UnlockOperatorBO unlockOperatorBO) throws Exception;

    BaseResult batchEnable(HttpServletRequest request, EnableOperatorBO enableOperatorBO) throws Exception;

    BaseResult batchDisable(HttpServletRequest request, DisableOperatorBO disableOperatorBO) throws Exception;
}
